<link rel="stylesheet" type="text/css" href="assets/bootstrap-datepicker/css/datepicker.css" />
<!-- 主页-请假管理-新增 -->
<section id="container">
    <!--main content start-->
    <section id="main-content">
        <section class="wrapper">
            <!--state overview end-->
            <div class="row">
                <div class="col-lg-12">
                    <!--<div class="alert alert-warning fade in">-->
                        <!--<button data-dismiss="alert" class="close close-sm" type="button">-->
                            <!--<i class="icon-remove"></i>-->
                        <!--</button>-->
                        <!--<strong>备注说明：</strong> 一个月最多补签2次，一条打卡时间计算1次。-->
                    <!--</div>-->

                    <section class="panel">
                        <header class="panel-heading">
                            补签信息
                        </header>
                        <div class="panel-body">
                            <div class="form-group customerForm">
                                <label class="col-sm-2 control-label">归属部门</label>
                                <div class="col-sm-10">
                                    <select id="deptCode" class="form-control" ng-model="deptCode" certus-required>
                                        <option ng-repeat="x in depts" value="{{x.departmentCode}}">{{x.departmentName}}</option>
                                    </select>
                                </div>
                            </div>
                            <!--<div class="form-group customerForm">-->
                                <!--<label class="col-sm-2 control-label">请假类型*</label>-->
                                <!--<div class="col-sm-10">-->
                                    <!--<select class="form-control" id="vacationType" name="vacationType">-->
                                        <!--<option value="{{x.vacationType}}" ng-repeat="x in type">{{x.comments}}</option>-->
                                    <!--</select>-->
                                <!--</div>-->
                            <!--</div>-->
                            <div class="form-group customerForm">
                                <label class="col-sm-2 control-label">补卡时间*</label>
                                <div class="col-sm-10">
                                    <div class="row">
                                        <div class="col-lg-4">
                                            <input type="text" class="form-control" disabled value="{{beginTime}}" placeholder="开始日期" name="beginTime" id="beginTime">
                                        </div>
                                        <div class="col-lg-4">
                                            <select class="form-control" id="hour" disabled ng-model="hour">
                                                <option value="08">08点</option>
                                                <option value="09">09点</option>
                                                <option value="10">10点</option>
                                                <option value="11">11点</option>
                                                <option value="12">12点</option>
                                                <option value="13">13点</option>
                                                <option value="14">14点</option>
                                                <option value="15">15点</option>
                                                <option value="16">16点</option>
                                                <option value="17">17点</option>
                                                <option value="18">18点</option>
                                                <option value="19">19点</option>
                                                <option value="20">20点</option>
                                                <option value="21">21点</option>
                                                <option value="22">22点</option>
                                                <option value="23">23点</option>
                                                <option value="24">24点</option>
                                            </select>
                                        </div>
                                        <div class="col-lg-4">
                                            <select class="form-control" id="min" disabled ng-model="min">
                                                <option value="00">00分</option>
                                                <option value="10">10分</option>
                                                <option value="20">20分</option>
                                                <option value="30">30分</option>
                                                <option value="40">40分</option>
                                                <option value="50">50分</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!--<div class="form-group customerForm">-->
                                <!--<label class="col-sm-2 control-label">补卡时间2</label>-->
                                <!--<div class="col-sm-10">-->
                                    <!--<div class="row">-->
                                        <!--<div class="col-lg-4">-->
                                            <!--<input type="text" class="form-control" value="{{beginTime2}}" disabled placeholder="开始日期" name="beginTime2" id="beginTime2">-->
                                        <!--</div>-->
                                        <!--<div class="col-lg-4">-->
                                            <!--<select class="form-control" id="hour2" disabled ng-model="hour2">-->
                                                <!--<option value="08">08</option>-->
                                                <!--<option value="09">09</option>-->
                                                <!--<option value="10">10</option>-->
                                                <!--<option value="11">11</option>-->
                                                <!--<option value="12">12</option>-->
                                                <!--<option value="13">13</option>-->
                                                <!--<option value="14">14</option>-->
                                                <!--<option value="15">15</option>-->
                                                <!--<option value="16">16</option>-->
                                                <!--<option value="17">17</option>-->
                                                <!--<option value="18">18</option>-->
                                                <!--<option value="19">19</option>-->
                                                <!--<option value="20">20</option>-->
                                                <!--<option value="21">21</option>-->
                                                <!--<option value="22">22</option>-->
                                                <!--<option value="23">23</option>-->
                                                <!--<option value="24">24</option>-->
                                            <!--</select>-->
                                        <!--</div>-->
                                        <!--<div class="col-lg-4">-->
                                            <!--<select class="form-control" id="min2" disabled ng-model="min2">-->
                                                <!--<option value="00">00</option>-->
                                                <!--<option value="10">10</option>-->
                                                <!--<option value="20">20</option>-->
                                                <!--<option value="30">30</option>-->
                                                <!--<option value="40">40</option>-->
                                                <!--<option value="50">50</option>-->
                                            <!--</select>-->
                                        <!--</div>-->
                                    <!--</div>-->
                                <!--</div>-->
                            <!--</div>-->
                            <!--<div class="form-group customerForm">-->
                                <!--<label class="col-sm-2 control-label">紧急联系电话</label>-->
                                <!--<div class="col-sm-10">-->
                                    <!--<input type="number" class="form-control" certus-required name="telephone" id="telephone">-->
                                <!--</div>-->
                            <!--</div>-->

                            <div class="form-group customerForm">
                                <label class="col-sm-2 control-label">说明</label>
                                <div class="col-sm-10">
                                    <textarea class="form-control" maxlength="120" placeholder="请说明补卡原因" disabled id="comments">{{comments}}</textarea>
                                </div>
                            </div>
                        </div>
                    </section>

                    <section class="panel">
                            <div class="panel-body">
                                <p class="default-buttons">
                                    <a href="javascript:void(0);" class="button-back btn btn-info" onclick="window.history.back()">返回</a>
                                    <a href="javascript:void(0);" class="button-next  btn btn-info" onclick="window.history.back()">确认</a>
                                </p>
                            </div>
                        </section>

                    <section>
                        <a href="javascript:void(0);" class="second" id="process" onclick="shaper();">
                            流程跟踪
                        </a>
                    </section>
                    <!-- 流程跟踪展示效果 -->
                    <section class="hdaper">
                        <div class="panel">
                            <div class="panel-heading add-heading">
                                流程跟踪
                                <i class="add-icon icon-remove" href="javascript:$.pageslide.close()" onclick="hdaper();"></i>
                            </div>
                            <div class="panel-body panel-proce">
                                <div class="proce-middle" id="nodeContiner"></div>
                            </div>
                        </div>
                        <div class="paper-bg"  onclick="clsbox();"></div>
                    </section>

                </div>
            </div>
        </section>
    </section>
    <!--main content end-->
</section>
<script type="text/javascript">
    var stepId = $CertusJsonAjax.getStepInstanceId();
    var processId = $CertusJsonAjax.getProInstanceId();
    $CertusFormAjax.ajax('initDepts',{},function (response) {
        var data = response.data;
        $$scope.depts = data;
        if (data.length==1){
            $("#deptCode").attr("disabled","disabled");
        }
        $$scope.deptCode = data[0].departmentCode;
    });

    $CertusFormAjax.ajax('findSingSps',{"processId":processId},function (response) {
        var data = response.data;
        var signTime = data.signTime;
        var times = signTime.split(",");
        var hm1 = times[0].split(" ")[1].split(":");
        //补卡时间至少有一条
        if (times.length>1){
            var hm2 = times[1].split(" ")[1].split(":");
            $$scope.hour2 = hm2[0];
            $$scope.min2 = hm2[1];
            $$scope.beginTime2 = times[1].split(" ")[0];
        }
        $$scope.beginTime =times[0].split(" ")[0];
        $$scope.hour = hm1[0];
        $$scope.min = hm1[1];
        $$scope.comments = data.comments;
    });
</script>
<script type="text/javascript" src="js/leave/signSpNode.js"></script>